Integrand size = 41, antiderivative size = 115 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx=\frac {(i A (1-n)+B (1+n)) \operatorname {Hypergeometric2F1}\left (1,n,1+n,\frac {1}{2} (1-i \tan (e+f x))\right ) (c-i c \tan (e+f x))^n}{4 a f n}+\frac {(i A-B) (c-i c \tan (e+f x))^n}{2 a f (1+i \tan (e+f x))} \]
1/4*(I*A*(1-n)+B*(1+n))*hypergeom([1, n],[1+n],1/2-1/2*I*tan(f*x+e))*(c-I* c*tan(f*x+e))^n/a/f/n+1/2*(I*A-B)*(c-I*c*tan(f*x+e))^n/a/f/(1+I*tan(f*x+e) )
Time = 1.42 (sec) , antiderivative size = 98, normalized size of antiderivative = 0.85 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx=\frac {(c-i c \tan (e+f x))^n \left (2 (A+i B) n+(-i A (-1+n)+B (1+n)) \operatorname {Hypergeometric2F1}\left (1,n,1+n,-\frac {1}{2} i (i+\tan (e+f x))\right ) (-i+\tan (e+f x))\right )}{4 a f n (-i+\tan (e+f x))} \]
((c - I*c*Tan[e + f*x])^n*(2*(A + I*B)*n + ((-I)*A*(-1 + n) + B*(1 + n))*H ypergeometric2F1[1, n, 1 + n, (-1/2*I)*(I + Tan[e + f*x])]*(-I + Tan[e + f *x])))/(4*a*f*n*(-I + Tan[e + f*x]))
Time = 0.35 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.03, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.122, Rules used = {3042, 4071, 27, 87, 78}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{a+i a \tan (e+f x)}dx\) |
\(\Big \downarrow \) 4071 |
\(\displaystyle \frac {a c \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^{n-1}}{a^2 (i \tan (e+f x)+1)^2}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {c \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^{n-1}}{(i \tan (e+f x)+1)^2}d\tan (e+f x)}{a f}\) |
\(\Big \downarrow \) 87 |
\(\displaystyle \frac {c \left (\frac {1}{2} (A (1-n)-i B (n+1)) \int \frac {(c-i c \tan (e+f x))^{n-1}}{i \tan (e+f x)+1}d\tan (e+f x)+\frac {(-B+i A) (c-i c \tan (e+f x))^n}{2 c (1+i \tan (e+f x))}\right )}{a f}\) |
\(\Big \downarrow \) 78 |
\(\displaystyle \frac {c \left (\frac {i (A (1-n)-i B (n+1)) (c-i c \tan (e+f x))^n \operatorname {Hypergeometric2F1}\left (1,n,n+1,\frac {1}{2} (1-i \tan (e+f x))\right )}{4 c n}+\frac {(-B+i A) (c-i c \tan (e+f x))^n}{2 c (1+i \tan (e+f x))}\right )}{a f}\) |
(c*(((I/4)*(A*(1 - n) - I*B*(1 + n))*Hypergeometric2F1[1, n, 1 + n, (1 - I *Tan[e + f*x])/2]*(c - I*c*Tan[e + f*x])^n)/(c*n) + ((I*A - B)*(c - I*c*Ta n[e + f*x])^n)/(2*c*(1 + I*Tan[e + f*x]))))/(a*f)
3.8.5.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(b *c - a*d)^n*((a + b*x)^(m + 1)/(b^(n + 1)*(m + 1)))*Hypergeometric2F1[-n, m + 1, m + 2, (-d)*((a + b*x)/(b*c - a*d))], x] /; FreeQ[{a, b, c, d, m}, x] && !IntegerQ[m] && IntegerQ[n]
Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p _.), x_] :> Simp[(-(b*e - a*f))*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(f*(p + 1)*(c*f - d*e))), x] - Simp[(a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)))/(f*(p + 1)*(c*f - d*e)) Int[(c + d*x)^n*(e + f*x)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && LtQ[p, -1] && ( !LtQ[n, -1] || Intege rQ[p] || !(IntegerQ[n] || !(EqQ[e, 0] || !(EqQ[c, 0] || LtQ[p, n]))))
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Si mp[a*(c/f) Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x], x , Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]
\[\int \frac {\left (A +B \tan \left (f x +e \right )\right ) \left (c -i c \tan \left (f x +e \right )\right )^{n}}{a +i a \tan \left (f x +e \right )}d x\]
\[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx=\int { \frac {{\left (B \tan \left (f x + e\right ) + A\right )} {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{n}}{i \, a \tan \left (f x + e\right ) + a} \,d x } \]
integral(1/2*((A - I*B)*e^(2*I*f*x + 2*I*e) + A + I*B)*(2*c/(e^(2*I*f*x + 2*I*e) + 1))^n*e^(-2*I*f*x - 2*I*e)/a, x)
\[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx=- \frac {i \left (\int \frac {A \left (- i c \tan {\left (e + f x \right )} + c\right )^{n}}{\tan {\left (e + f x \right )} - i}\, dx + \int \frac {B \left (- i c \tan {\left (e + f x \right )} + c\right )^{n} \tan {\left (e + f x \right )}}{\tan {\left (e + f x \right )} - i}\, dx\right )}{a} \]
-I*(Integral(A*(-I*c*tan(e + f*x) + c)**n/(tan(e + f*x) - I), x) + Integra l(B*(-I*c*tan(e + f*x) + c)**n*tan(e + f*x)/(tan(e + f*x) - I), x))/a
Exception generated. \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx=\text {Exception raised: RuntimeError} \]
\[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx=\int { \frac {{\left (B \tan \left (f x + e\right ) + A\right )} {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{n}}{i \, a \tan \left (f x + e\right ) + a} \,d x } \]
Timed out. \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx=\int \frac {\left (A+B\,\mathrm {tan}\left (e+f\,x\right )\right )\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^n}{a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}} \,d x \]